#include "ClientReq.h"



void Realtime_Tick(PosixTestClient *client,TickerID id/* */){
     //Client->reqMktData(id, contract, genericTicklist, snapshot);
     return;

}

void Realtime_Bar(PosixTestClient *client, int id,int bar_size){
     //client->reqRealTimeBars(id, contract, bar_Size, "whatToShow", 0);
     return;
}
void EMA(/*id, Security def, int bar size, int num_bars*/){
     //get the data, store into array, call EMA_calc
     return;
}
double* EMA_calc(double* array, int size){
     if(size == 0){
       return NULL;
     }

     double ema[size]; // = malloc(sizeof(double)*size);
     double a = 2/(size+1);
     ema[0] = array[0];
     for(int i = 1; i < size; i++){
       ema[i] = a*array[i] + (1-a)*ema[i-1];
     }
     return &ema[0];
     
     
}

void MACD(/*id, sec def, int bar size*/){
  
     //MACD = EMA[length1] - EMA[length2];
     
     //EMA2 = ema(MACD)
     //signal = EMA[length3];
     //histogram = MACD[i] - signal[i];
     
     return;
}

void cancel_Tick(PosixTestClient *client, TickerID id){
     //client->cancelMktData(id);
     return;
}
void cancel_Bar(PosixTestClient *client, int id){
     //client->cancelRealTimeBars(id);
     return;
}
void cancel_EMA(/*id*/){
     //client->cancelRealTimeBars(id);
     return;
}
void cancel_MACD(/*id*/){
    //client->cancelRealTimeBars(id);
    return;
}
